
'use strict';

/**
	Part of Zombie Navigator
	Copyright © 2015  Zombie Navigator Developers
	
	@file
	@module
	@license AGPL-3.0+
*/


/* Addon SDK dependencies */
const _sdkURL = require('sdk/url');


/* Exported APIs */

/**
	@public
	@method
	@param {string} path
	@returns {string}
*/
const filenameToURI = path => {
	path = path + '';
	
	const sdkURL = _sdkURL;
	
	try {
		return sdkURL.fromFilename(path) + '';
	} catch (e) {
		throw new Error(e + '');
	}
};


/* Exports */
exports.filenameToURI = filenameToURI;


// vim: ts=4 noet ai

